<template>
	<view>
		<!--pages/template/template.wxml-->
		<template name="address">
			<view class="address" @tap="chooseAddress">
				<view class="addressImg">
					<image src="/static/images/address-1.png"></image>
				</view>
				<view class="addressBox">
					<view class="addressCon" v-if="name">
						<view class="addressInfo">
							<text class="name-info-margin">{{name}}</text>{{phone}}
						</view>
						<view class="addressDetail">{{address}}</view>
					</view>
					<view class="addressCon" v-else>请选择收货地址</view>
				</view>
				<view class="address-arrow">
					<image src="/static/images/arrow-1.png"></image>
				</view>
			</view>
		</template>
		<template name="share">
			<!-- 分享 -->
			<view :hidden="maskShare == false" class="alert-make">
				<view @tap="closeShare" class="alert-view-close" @longtap="closeShare" @touchmove="closeShare"></view>
				<view class="shareBox">
					<view class="shareTop">
						<view class="share-left" @tap="formSubmit">
							<image src="https://safood.supplyocta.com/Public/MallSmallApp/photo.png"></image>
							<view>生成海报</view>
						</view>
						<button class="share-right" open-type="share">
							<image src="/static/images/share-friends.png"></image>
							<view>转发</view>
						</button>
					</view>
					<view class="shareBottom" @tap="closeShare">取消分享</view>
				</view>
			</view>
			<!-- 生成海报 -->
			<view class="alert-make" :hidden="maskHidden == false">
				<view @tap="closeHidden" class="alert-view-close" @longtap="closeHidden" @touchmove="closeHidden">
				</view>
				<view class="imagePathBox">
					<image :src="imagePath" class="code-img" mode="widthFix"></image>
				</view>
				<button class="save-img" @tap="saveImg">保存到相册</button>
			</view>

			<view class="canvas-box">
				<!-- #ifdef MP-WEIXIN -->
				<canvas class="mycanvas-box-position" canvas-id="mycanvas"></canvas>
				<!-- #endif -->
				<!-- #ifdef MP-ALIPAY -->
				<canvas class="mycanvas-box-position" id="mycanvas"></canvas>
				<!-- #endif -->
			</view>
		</template>
	</view>
</template>

<style>
	@import "./template.css";
</style>
